/*
    此处是业务波次的方法接口调用维护
    用处：
    在表格组件内使用 import {方法名} from '@/api/business/wave' 进行调用
*/
import request from "@/utils/fetch";

// 定义公共的请求首部关键词
const SYSTEM_URL = "";

// 波次策略组合表 查询数据接口
export function getOutWaveStrategyGroupEntryList(page, data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyGroup/queryList/` + page,
    method: "POST",
    data: data,
  });
}

// 波次策略组合表 新增接口
export function outWaveStrategyGroupSave(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyGroup/save`,
    method: "POST",
    data: data,
  });
}

// 波次策略组合表 编辑接口
export function outWaveStrategyGroupEdit(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyGroup/updateOutWaveStrategyGroup`,
    method: "POST",
    data: data,
  });
}

// 波次策略组合表 编辑接口
export function outWaveStrategyGroupDelete(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyGroup/delete`,
    method: "DELETE",
    data: data,
  });
}

// 波次策略组合表 查询详情
export async function outWaveStrategyGroupQuery(id) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyGroup/${id}`,
    method: "get",
  });
}

// 打印快递单
export function printTheCourierNote(waveNumber) {
  return request({
    url: SYSTEM_URL + `/getordersByWave/` + waveNumber,
    method: "get",
  });
}

// 打印发货单
export function printInvoice(waveNumber) {
  return request({
    url: SYSTEM_URL + `/getRtxtaskgrpByWave/` + waveNumber,
    method: "get",
  });
}

// 查询波次单据打印(WaveDocPrint)列表
export function getWaveDocPrintEntryList(page, data) {
  data.pageNum = page;
  return request({
    url: SYSTEM_URL + `/queryWaveList`,
    method: "POST",
    data: data,
  });
}

//    ========================= 波次计划 =========================

// 波次计划维护 查询数据接口
export function getOutWaveStrategyPlanList(page, data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyPlan/queryList/` + page,
    method: "POST",
    data: data,
  });
}

// 波次计划维护 保存
export function outWaveStrategyPlanSave(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyPlan/save`,
    method: "POST",
    data: data,
  });
}

// 波次计划维护 编辑
export function outWaveStrategyPlanEdit(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyPlan/updateOutWaveStrategyPlan`,
    method: "POST",
    data: data,
  });
}

// 波次计划维护 查询波次策略名称
export function outWaveStrategyPlanQueryGroupName(filterName) {
  return request({
    url: SYSTEM_URL + `/fuzzyQueryFilterByFilterName/${filterName}`,
    method: "post",
  });
}

// 波次策略组合表 批量删除
export function outWaveStrategyPlanDelete(data) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyPlan/delete`,
    method: "DELETE",
    data: data,
  });
}

// 面板信息-波次计划维护
export function queryThisWeekSPlanData(week) {
  return request({
    url: SYSTEM_URL + `/outWaveStrategyPlan/panel/` + week,
    method: "get",
  });
}

//  波次计划创建 波次策略订单分布
export function queryByWaveStrategyGroup(data) {
  return request({
    url: SYSTEM_URL + `/rtxwavecreate/queryByWaveStrategyGroup`,
    method: "post",
    data: data,
  });
}

//  波次计划创建 波次策略订单
export function queryByWaveStrategyGroupDefault(data) {
  return request({
    url: SYSTEM_URL + `/rtxwavecreate/queryByWaveStrategyGroupDefault`,
    method: "post",
    data: data,
  });
}

//  波次计划创建 订单总计
export function queryOrderStatistics(data) {
  return request({
    url: SYSTEM_URL + `/rtxwavecreate/queryOrderStatistics`,
    method: "post",
    data: data,
  });
}

//  波次计划创建 订单波次list
export function queryWaveList(data) {
  return request({
    url: SYSTEM_URL + `/rtxwavecreate/queryWaveList`,
    method: "post",
    data: data,
  });
}

//  波次计划创建 策略查询接口
export function queryStrategyList(data) {
  return request({
    url: SYSTEM_URL + `/rtxwavecreate/queryOutWaveStrategyGroup`,
    method: "post",
    data: data,
  });
}
